#include "sharemem.hpp"

int main()
{
    int shmid = creatnewshm();
    char *poi = (char *)shmat(shmid, nullptr, 0);
    cout << "关联共享内存成功" << endl;

    while (true)
    {
        cout<<"服务器接收："<<poi<<endl;
        sleep(1);
    }
    
    shmdt(poi);
    shmctl(shmid,IPC_RMID,nullptr);

    return 0;
}